`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer: 
// 
// Create Date:    02:34:21 02/24/2012 
// Design Name: 
// Module Name:    pcie_axi_bridge 
// Project Name: 
// Target Devices: 
// Tool versions: 
// Description: 
//
// Dependencies: 
//
// Revision: 
// Revision 0.01 - File Created
// Additional Comments: 
//
//////////////////////////////////////////////////////////////////////////////////
module SlaveBridge(
  input           CLK,
  input           RST,
  
  input           S_TVALID,
  output          S_TREADY,
  input   [127:0] S_TDATA,
  input   [3:0]   S_TSTRB,
  input           S_TLAST,
  output          M_TVALID,
  input           M_TREADY,
  output  [127:0] M_TDATA,
  output  [3:0]   M_TSTRB,
  output          M_TLAST,
  
  input   [31:0]  S_AWADDR,
  input           S_AWVALID,
  output          S_AWREADY,
  input   [31:0]  S_WDATA,
  input   [3:0]   S_WSTRB,
  input           S_WVALID,
  output          S_WREADY,
  output  [1:0]   S_BRESP,
  output          S_BVALID,
  input           S_BREADY,
  input   [31:0]  S_ARADDR,
  input           S_ARVALID,
  output          S_ARREADY,
  output  [31:0]  S_RDATA,
  output  [1:0]   S_RRESP,
  output          S_RVALID,
  input           S_RREADY
  );

  wire        s32_tvalid;
  wire        s32_tready;
  wire [31:0] s32_tdata;
  wire        s32_tlast;
  wire        m32_tvalid;
  wire        m32_tready;
  wire [31:0] m32_tdata;
  wire        m32_tlast;

  axis_quarter_width #(
    .DWIDTH  (128),
    .KWIDTH  (4))
  quarter_conv(
    .clk        (CLK),
    .rst        (RST),
      
    .s_tvalid   (S_TVALID  ),
    .s_tready   (S_TREADY  ),
    .s_tdata    (S_TDATA   ),
    .s_tkeep    (S_TSTRB   ),
    .s_tlast    (S_TLAST   ),

    .m_tvalid   (s32_tvalid  ),
    .m_tready   (s32_tready  ),
    .m_tdata    (s32_tdata   ),
    .m_tkeep    (            ),
    .m_tlast    (s32_tlast   )
  );
  
  axis_quad_width #(
    .DWIDTH  (32),
    .KWIDTH  (1))
  quad_conv(
    .clk        (CLK),
    .rst        (RST),
      
    .s_tvalid   (m32_tvalid  ),
    .s_tready   (m32_tready  ),
    .s_tdata    (m32_tdata   ),
    .s_tkeep    (1'b1        ),
    .s_tlast    (m32_tlast   ),

    .m_tvalid   (M_TVALID  ),
    .m_tready   (M_TREADY  ),
    .m_tdata    (M_TDATA   ),
    .m_tkeep    (M_TSTRB   ),
    .m_tlast    (M_TLAST   )
  );
endmodule
